
import React, { Component, createRef } from 'react';
import Life from './views/Life/Life'

class App extends Component {
  constructor(props) {
    super(props)
    // 创建ref对象
    this.lifeRef = createRef();
  }
  componentDidMount() {
    console.log(this.lifeRef);
    console.log(this.lifeRef.current);
  }
  render() {
    return (
      <div>
        <Life ref={this.lifeRef}></Life>
      </div>
    );
  }
}

export default App;



